package com.easyweb.entity;

// Generated May 29, 2009 4:16:57 PM by Hibernate Tools 3.2.4.GA

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.OneToMany;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Ulke generated by hbm2java
 */
@Entity
@Table
public class Ulke implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	private Long id;

	@Version
	@Column(name = "version")
	private Integer version;

	@Column(name = "ulkeAdi", nullable = false, length = 50)
	@NotNull(message = "#{messages.errBosOlamaz}")
	@Length(max = 50, message = "#{messages.errUzunlukElliGecemez}")
	private String ulkeAdi;

	@Column(name = "ulkeKodu", nullable = false, length = 5)
	@NotNull(message = "#{messages.errBosOlamaz}")
	@Length(max = 5, message = "#{messages.errUzunlukBesGecemez}")
	private String ulkeKodu;
	
	@OneToMany(fetch=FetchType.LAZY,cascade=CascadeType.ALL,mappedBy="ulke")
	private List<Iller> illers; 
 
	@Column(name = "iptal", length = 1)
	private char iptal;

	public Ulke() {
	}
 
 
	public Ulke(String ulkeAdi, String ulkeKodu, List<Iller> illers, char iptal) {
		super();
		this.ulkeAdi = ulkeAdi;
		this.ulkeKodu = ulkeKodu;
		this.illers = illers;
		this.iptal = iptal;
	}
 
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public String getUlkeAdi() {
		return ulkeAdi;
	}

	public void setUlkeAdi(String ulkeAdi) {
		this.ulkeAdi = ulkeAdi;
	}

	public String getUlkeKodu() {
		return ulkeKodu;
	}

	public void setUlkeKodu(String ulkeKodu) {
		this.ulkeKodu = ulkeKodu;
	}

 

	public char getIptal() {
		return iptal;
	}

	public void setIptal(char iptal) {
		this.iptal = iptal;
	}

	public List<Iller> getIllers() {
		return illers;
	}

	public void setIllers(List<Iller> illers) {
		this.illers = illers;
	}

	 
}
